<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />	
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body">

			<h:form id="firmaDetayForm">
				<c:choose>
					<c:when test="${SirketprofilBean.selectedSirket != null}">
						<p:commandButton id="firmaList" value="Sirket Listesine Dön"
							actionListener="#{SirketprofilBean.deleteSelectedSirket}"
							update=":firmaDetayForm" />
							
						
						<p:commandButton id="firmaProducts" value="Sirket Ürünleri"
							action="#{AygitBean.getUreticiAygitlari(SirketprofilBean.selectedSirket)}"/>
							
						<p:commandButton id="firmaSoftwares" value="Sirket Yazılımları"
							action="#{AygitYazilimlariBean.getUreticiYazilimlari(SirketprofilBean.selectedSirket)}"/>
						<br></br>

						<p:tabView effect="puff" effectDuration="normal">

							<p:tab title="Şirket Profil">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.profilAciklama}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="Vizyon">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.vizyon}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="Misyon">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.misyon}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="IK Politika">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.ikPolitikasi}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="Kalite">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.kalitePolitikasi}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="Çevre">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:outputText
										value="#{SirketprofilBean.selectedSirket.cevrePolitikasi}" />
								</h:panelGrid>
							</p:tab>
							<p:tab title="İletişim">
								<h:panelGrid columns="2" cellpadding="10">
									<!-- <p:graphicImage value="/images/godfather/godfather1.jpg" /> -->
									<h:panelGrid columns="2" cellpadding="10">
										<h:outputText value="Tel: " />
										<h:outputText id="tel1"
										 value="#{SirketprofilBean.selectedSirket.tel1} -- 
										 	#{SirketprofilBean.selectedSirket.tel2}"
											style="font-weight: bold" />

										<h:outputText value="Fax: " />
										<h:outputText id="fax" value="#{SirketprofilBean.selectedSirket.fax}"
											style="font-weight: bold" />

										<h:outputText value="e-mail: " />
										<h:outputText id="email" value="#{SirketprofilBean.selectedSirket.email}"
											style="font-weight: bold" />
											
										<h:outputText value="Web Page: " />
										<h:outputText id="webpage" value="#{SirketprofilBean.selectedSirket.webAdd}"
											style="font-weight: bold" />
										
										<h:outputText value="Adres: " />
										<h:outputText id="adres" 
										  value="#{SirketprofilBean.selectedSirket.mahalle} , #{SirketprofilBean.selectedSirket.sokak}, 
										  #{SirketprofilBean.selectedSirket.numara}, #{SirketprofilBean.selectedSirket.ilce}, 
										  #{SirketprofilBean.selectedSirket.il}"
											style="font-weight: bold" />
									</h:panelGrid>
								</h:panelGrid>
							</p:tab>
						</p:tabView>
					</c:when>
					<c:otherwise>						

						<p:dataTable id="sirketler" var="sirketListe"
							value="#{SirketprofilBean.sirketproList}" paginator="true"
							rows="10"
							paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks}
                				  {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
							rowsPerPageTemplate="5,10,15">
							<f:facet name="header">  
            						Şirket Listesi  
        						</f:facet>
							<p:column>
								<f:facet name="header">
									<h:outputText value="Firma Adı" />
								</f:facet>
								<h:outputText value="#{sirketListe.firmaAd}" />
							</p:column>

							<p:column>
								<f:facet name="header">
									<h:outputText value="Açıklama" />
								</f:facet>
								<h:inputText value="#{sirketListe.profilAciklama}" size="20"
									readonly="true" disabled="true"
									style="color:Red;font-style:italic;border:0;" />
							</p:column>

							<p:column>
								<f:facet name="header">
									<h:outputText value="il-ilçe" />
								</f:facet>
								<h:outputText value="#{sirketListe.il}, #{sirketListe.ilce}  " />
							</p:column>

							<p:column>
								<f:facet name="header">
									<h:outputText value="Telefon" />
								</f:facet>
								<h:outputText value="#{sirketListe.tel1} " />
							</p:column>

							<p:column style="width:40px">
								<f:facet name="header">
									<h:outputText value="Detay" />
								</f:facet>
								<h:panelGrid columns="3" styleClass="actions" cellpadding="2">
									<p:commandButton id="selectSirket" update=":firmaDetayForm"
										icon="ui-icon-search" title="Göster"
										action="submit">
										<f:setPropertyActionListener value="#{sirketListe}"
											target="#{SirketprofilBean.selectedSirket}" />
									</p:commandButton>
								</h:panelGrid>
							</p:column>

						</p:dataTable>
					</c:otherwise>
				</c:choose>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>